    var opt_before = document.getElementById('optimize_l');
    var opt_after = document.getElementById('optimize_r');
    var mis_task = document.getElementById('mission_task');
    var mis_his = document.getElementById("mission_his");
    /*成本分析 优化前*/
    var all_money = 45824.4;
    optBOption = {
            title : {
                text: '根据故障次序排程费用',
                textStyle:{
                    color:'#0eb1e6',
                    fontSize:14,
                    fontWeight:'bold'
                },
                subtext: '总费用:'+all_money.toString()+'元',
                subtextStyle:{
                    color:'#0eb1e6',
                    fontSize:14,
                    fontWeight:'bold'
                },
                x:320,
                y:15
            },
            tooltip : {
                show:false,
                trigger: 'item',
                //formatter: "{d}%",
                alwaysShowContent:true
            },
            legend: {
                textStyle:{
                    color:'#e6e6e6'
                },
                orient: 'vertical',
                left: 320,
                top:70,
                data: ['功率损失','船舶租赁','燃油费用','工人工资','加班工资']
            },
            color:['#2980b9','#f39c12','#8e44ad','#27ae60','#c0392b'],
            series : [
                {
                    type: 'pie',
                    radius :['10%', '85%'],
                    center: ['35%', '46%'],
                    data:[
                        {value:13124.4, name:'功率损失'},
                        {value:13500, name:'船舶租赁'},
                        {value:10750, name:'燃油费用'},
                        {value:8000, name:'工人工资'},
                        {value:450, name:'加班工资'}
                    ],
                    itemStyle: {
                        normal:{
                            label:{
                                show:true,
                                position:'inside',
                                formatter:'{d}%'
                            }
                        }
                    }
                }
            ]
        };
    optBLine = echarts.init(opt_before);
    //optBLine.showLoading();
    optBLine.setOption(optBOption);

    /*成本分析 优化后*/
    optAOption = {
            title : {
                text: '根据故障次序排程费用',
                textStyle:{
                    color:'#0eb1e6',
                    fontSize:14,
                    fontWeight:'bold'
                },
                subtext: '总费用：29829.1 万元\n\n 优化率：34.91%',
                subtextStyle:{
                    color:'#0eb1e6',
                    fontSize:14,
                    fontWeight:'bold'
                },
                x:320,
                y:0
            },
            tooltip : {
                show:false,
                trigger: 'item',
                formatter: "{d}%",
                alwaysShowContent:true
            },
            legend: {
                textStyle:{
                    color:'#e6e6e6'
                },
                orient: 'vertical',
                left: 320,
                top:80,
                data: ['功率损失','船舶租赁','燃油费用','工人工资','加班工资']
            },
            color:['#2980b9','#f39c12','#8e44ad','#27ae60','#c0392b'],
            series : [
                {
                    type: 'pie',
                    radius :['10%', '65%'],
                    center: ['35%', '46%'],
                    data:[
                        {value:7554.1, name:'功率损失'},
                        {value:9000, name:'船舶租赁'},
                        {value:8750, name:'燃油费用'},
                        {value:4000, name:'工人工资'},
                        {value:525, name:'加班工资'}
                    ],
                    itemStyle: {
                        normal:{
                            label:{
                                show:true,
                                position:'inside',
                                formatter:'{d}%'
                            }
                        }
                    }
                }
            ]
        };
    optALine=echarts.init(opt_after);
    //optALine.showLoading();
    optALine.setOption(optAOption);
    

    /*任务成本分析*/
    var nameData=['task01', 'task02', 'task03', 'task04', 'task05','task06','task07','task08','task09','task10'];
    var moneyData =[2635.693334, 2341.3988, 456.9838, 548.4066672, 336.7020001, 2098.098933, 1445.080268, 1745.51953, 980.6226677, 4240.59267];
    var costOption = {
            color: ['#3398DB'],
            textStyle:{
                color:'#e6e6e6',
                fontSize:14
            },

            left:30,
            top:38,
            tooltip : {
                trigger: 'axis',
                axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                    type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis :
                {
                    //type : 'category',
                    data : nameData,
                    axisTick: {
                        alignWithLabel: true
                    }
                },
            yAxis : [
                {
                    type : 'value',
                    name:'(元)',
                    splitLine:{
                        show:true,
                        lineStyle:{
                            color:['#2b2b2d'],
                            type:'solid',
                            width:1
                        }
                    }
                }
            ],
            series : [
                {
                    name:'任务成本',
                    type:'bar',
                    barWidth: '60%',
                    data:moneyData,
                    //barGap:'30%'
                }
            ]
        };
    var costLine=echarts.init(mis_task);
    //costLine.showLoading();
    costLine.setOption(costOption);

    /*历史成本分析*/
    var jsonData ={time:['17/2/23','17/2/24','17/2/25','17/2/26','17/2/27','17/2/28','17/3/1'],pow_loss:[7492.3,6588.4,6730.9,7429.1,8212.1,8155.2,7554.1],boatData:[9000,9000,9000,9000,9000,9000,9000],workerData:[4000,8000,4000,8000,8000,4000,8000],oiData:[8300,8250,8600,8300,8900,8550,8750],overTimeData:[450,475,450,525,475,525,525],allplay:[29242.3, 32313.4, 28780.9, 33254.1, 34587.1, 30230.2, 33829.1]};
    var costHisOption = {
            title:{
                text:'历史成本分析',
                textStyle:{
                    color:'#e6e6e6',
                    fontSize:16
                },
                left:43,
                top:60
            },
            grid:{
                left:'10%',
                right:'15%',
                top:'30%',
                bottom:'5%'
            },
            legend:{
                show:true,
                width:300,
                height:30,
                left:300,
                top:60,
                orient:'horizontal',
                data: ['功率损失','船舶租赁','燃油费用','工人工资','加班工资'],
                textStyle:{
                    color:'#e6e6e6',
                    fontSize:10
                },
                itemWidth:10,
                itemHeight:10

            },
            tooltip: {
                //trigger: "axis",
                axisPointer: {
                    textStyle: {
                        color: "#fff"
                    }
                }
            },
            calculable: true,
            xAxis: [{
                name:'(时间)',
                nameTextStyle:{
                    color:'#fff'
                },
                type: "category",
                axisLine: {
                    lineStyle: {
                        color: '#2c2c2d',
                        opacity:0.2
                    }
                },
                splitLine: {
                    "show": false
                },
                axisTick: {
                    "show": false
                },
                splitArea: {
                    "show": false
                },
                axisLabel: {
                    interval: 0,
                    textStyle:{
                        color:'#e6e6e6'
                    }
                },
                data:jsonData.time
            }],
            yAxis: [{
                name:'(元)',
                max:100000,
                nameTextStyle:{
                    color:'#fff'
                },
                type: "value",
                axisLine: {
                    lineStyle: {
                        color: '#2c2c2d'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    interval: 0,
                    textStyle:{
                        color:'#e6e6e6',
                    }
                },
                splitLine:{
                    show:true,
                    lineStyle:{
                        color:['#2b2b2d'],
                        type:'solid',
                        width:1
                    }
                }
            }],
            series: [
                {
                    name: "功率损失",
                    type: "bar",
                    stack: "总量",
                    barMaxWidth: 35,
                    barGap: "10%",
                    itemStyle: {
                        normal: {
                            color: "#2980b9",
                            label: {
                                show: false,
                                textStyle: {
                                    color: "#479139"
                                },
                                formatter: function(p) {
                                    return p.value > 0 ? (p.value) : '';
                                }
                            }
                        }
                    },
                    data: jsonData.pow_loss
                },
                {
                    name: "船舶租赁",
                    type: "bar",
                    stack: "总量",
                    itemStyle: {
                        normal: {
                            "color": "#f39c12",
                            "barBorderRadius": 0,
                        }
                    },
                    data:jsonData.boatData
                },
                {
                    "name": "工人工资",
                    "type": "bar",
                    "stack": "总量",
                    "itemStyle": {
                        "normal": {
                            "color": "#27ae60",
                            "barBorderRadius": 0,
                        }
                    },
                    "data": jsonData.workerData
                },
                {
                    "name": "燃油费用",
                    "type": "bar",
                    "stack": "总量",
                    "itemStyle": {
                        "normal": {
                            "color": "#8e44ad",
                            "barBorderRadius": 0,

                        }
                    },
                    "data": jsonData.oiData
                },
                {
                    "name": "加班工资",
                    "type": "bar",
                    "stack": "总量",
                    "itemStyle": {
                        "normal": {
                            "color": "#c0392b",
                        }
                    },
                    "data": jsonData.overTimeData
                },
                {
                    "name": "总数",
                    "type": "line",
                    symbolSize:10,
                    symbol:'circle',
                    "itemStyle": {
                        "normal": {
                            "color": "#56bfdc",
                            "barBorderRadius": 0,
                        }
                    },
                    lineStyle:{
                        normal:{
                            color:'#ffff09'
                        },
                    },
                    data: jsonData.allplay
                }
            ]
        };
    var costHisLine=echarts.init(mis_his);
    //costHisLine.showLoading();
    costHisLine.setOption(costHisOption);